]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dbusServices/screencast: Check for all require elements
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 24 Oct 2022 12:01:03 +0000 (14:01 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 4 Nov 2022 09:51:20 +0000 (09:51 +0000)
Instead of assuming that gst-plugins-good has been compiled with
all the plugins we need enabled, explicitly check for the ones
we use.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5710

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2519>

js/dbusServices/screencast/screencastService.js

index 7b47da27c0f1738f561747c37503ca4a596ce742..f7f36da886df212040c90e88b61abd910d155770 100644 (file)
@@ -259,9 +259,13 @@ var Recorder = class {
 
 var ScreencastService = class extends ServiceImplementation {
     static canScreencast() {
+        const elements = [
+            'pipewiresrc',
+            'filesink',
+            ...DEFAULT_PIPELINE.split('!').map(e => e.trim().split(' ').at(0)),
+        ];
         return Gst.init_check(null) &&
-            Gst.ElementFactory.find('pipewiresrc') &&
-            Gst.ElementFactory.find('filesink');
+            elements.every(e => Gst.ElementFactory.find(e) != null);
     }
 
     constructor() {